package cn.scut.srp.utils;

import cn.scut.srp.model.BaseResponse;
import cn.scut.srp.model.ResponseCode;

public class ResponseUtil {

    public static BaseResponse<ResponseCode> noInfo(Object msg){
        return new BaseResponse<>(ResponseCode.NO_INFO,msg,40400);
    }

    public static BaseResponse<ResponseCode> OK(Object msg){
        return new BaseResponse<>(ResponseCode.OK,msg,0);
    }

    public static BaseResponse<ResponseCode> notLogin(String msg) {
        return new BaseResponse<>(ResponseCode.NOT_LOGIN, msg, 40100);
    }

    public static BaseResponse<ResponseCode> loginExpired(String msg) {
        return new BaseResponse<>(ResponseCode.EXPIRED, msg, 40101);
    }

    public static BaseResponse<ResponseCode> notValid(String msg){
        return new BaseResponse<>(ResponseCode.NOT_VALID,msg, 40401);
    }
    public static BaseResponse<ResponseCode> nameAlreadyExist(String msg){
        return new BaseResponse<>(ResponseCode.ALREADY_EXIST,msg,40402);
    }

    public static BaseResponse<ResponseCode> UserNotExist(String msg){
        return new BaseResponse<>(ResponseCode.NOT_EXIST,msg,40403);
    }

    public static BaseResponse<ResponseCode> wrongPassword(String msg){
        return new BaseResponse<>(ResponseCode.WRONG_PWD,msg,40404);
    }

    public static BaseResponse<ResponseCode> noAuth(String msg){
        return new BaseResponse<>(ResponseCode.NO_AUTH,msg,40102);
    }

    public static BaseResponse<ResponseCode> noSchedule(String msg){
        return new BaseResponse<>(ResponseCode.NO_SCHEDULE,msg,40405);
    }

    public static BaseResponse<ResponseCode> noCourse(String msg) {
        return new BaseResponse<>(ResponseCode.NO_COURSE,msg,40406);
    }
}
